using System;
using System.ComponentModel;
using System.Transactions;
using SIS.DAL;
using SIS.ENT;


/// <summary>
/// The TeacherJobExperiencesTableManager class is responsible for managing BO.TeacherJobExperiencesTable objects in the system.
/// </summary>
[DataObjectAttribute()]
public class TeacherJobExperiencesTableManager
  {

#region "Public Methods"

/// <summary>
/// Gets a list with all TeacherJobExperiencesTable objects in the database.
/// </summary>
/// <returns>A list with all TeacherJobExperiencesTable from the database when the database contains any, or null otherwise.</returns>
[DataObjectMethod(DataObjectMethodType.Select, true)]
public static TeacherJobExperiencesTableList GetList(){
return TeacherJobExperiencesTableDB.GetList();
}

[DataObjectMethod(DataObjectMethodType.Select, true)]
public static TeacherJobExperiencesTableList GetList(int UserAccountKey)
{
    return TeacherJobExperiencesTableDB.GetList(UserAccountKey);
}

/// <summary>
/// Gets a single TeacherJobExperiencesTable from the database without its data.
/// </summary>
/// <param name="teacherJobExperienceKey">The TeacherJobExperienceKey of the TeacherJobExperiencesTable in the database.</param>
/// <returns>A TeacherJobExperiencesTable object when the TeacherJobExperienceKey exists in the database, or <see langword="null"/> otherwise.</returns>
[DataObjectMethod(DataObjectMethodType.Select, false)]
public static TeacherJobExperiencesTable GetItem(int teacherJobExperienceKey){
return GetItem(teacherJobExperienceKey, false);
}

/// <summary>
/// Gets a single TeacherJobExperiencesTable from the database.
/// </summary>
/// <param name="teacherJobExperienceKey">The TeacherJobExperienceKey of the TeacherJobExperiencesTable in the database.</param>
/// <param name="getTeacherJobExperiencesTableRecords">Determines whether to load all associated TeacherJobExperiencesTable records as well.</param>
/// <returns>
/// A TeacherJobExperiencesTable object when the TeacherJobExperienceKey exists in the database, or <see langword="null"/> otherwise.
/// </returns>
[DataObjectMethod(DataObjectMethodType.Select, false)]
public static TeacherJobExperiencesTable GetItem(int teacherJobExperienceKey, bool getTeacherJobExperiencesTableRecords){
TeacherJobExperiencesTable myTeacherJobExperiencesTable = TeacherJobExperiencesTableDB.GetItem(teacherJobExperienceKey);
return myTeacherJobExperiencesTable;
}

/// <summary>
/// Saves a TeacherJobExperiencesTable in the database.
/// </summary>
/// <param name="myTeacherJobExperiencesTable">The TeacherJobExperiencesTable instance to save.</param>
/// <returns>The new TeacherJobExperienceKey if the TeacherJobExperiencesTable is new in the database or the existing TeacherJobExperienceKey when an item was updated.</returns>
[DataObjectMethod(DataObjectMethodType.Update, true)]
public static int Save(TeacherJobExperiencesTable myTeacherJobExperiencesTable){
using (TransactionScope myTransactionScope = new TransactionScope()){
int teacherJobExperiencesTableTeacherJobExperienceKey = TeacherJobExperiencesTableDB.Save(myTeacherJobExperiencesTable);

//  Assign the TeacherJobExperiencesTable its new (or existing TeacherJobExperienceKey).
myTeacherJobExperiencesTable.TeacherJobExperienceKey = teacherJobExperiencesTableTeacherJobExperienceKey;

myTransactionScope.Complete();

return teacherJobExperiencesTableTeacherJobExperienceKey;
}
}

/// <summary>
/// Deletes a TeacherJobExperiencesTable from the database.
/// </summary>
/// <param name="myTeacherJobExperiencesTable">The TeacherJobExperiencesTable instance to delete.</param>
/// <returns>Returns true when the object was deleted successfully, or false otherwise.</returns>
[DataObjectMethod(DataObjectMethodType.Delete, true)]
public static bool Delete(TeacherJobExperiencesTable myTeacherJobExperiencesTable){
return TeacherJobExperiencesTableDB.Delete(myTeacherJobExperiencesTable.TeacherJobExperienceKey);
}

[DataObjectMethod(DataObjectMethodType.Delete, true)]
public static bool Delete(int TeacherJobExperienceKey)
{
    return TeacherJobExperiencesTableDB.Delete(TeacherJobExperienceKey);
}

#endregion

}

